<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>提示框</title>
</head>
<body>

<button>alert</button>
<button id="btnPrompt">prompt</button>
<button id="btnConfirm">confirm</button>
</body>
<script>

   var btnPrompt=  document.getElementById('btnPrompt');

   btnPrompt.onclick = function (){

    var message=   prompt('请输出你的姓名');

    alert(message);
   }


 var btnConfirm=  document.getElementById('btnConfirm');

   btnConfirm.onclick = function (){

        if(confirm("你确定要删除当前数据吗？")){

             alert('删除成功');
        }
   }

</script>


</html>